home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / printer / jcosub26.zip / MAKEWB < prev    next >
AmigaDOS Script File  |  1995-06-10  |  10KB  |  283 lines

  1. .KEY drive
  2.  
  3. ; AmigaDOS Shell script for creating a minimal Workbench disk, needs
  4. ; about 300K of free memory to execute.
  5. ; by Alex Matulich 10 June 1995
  6.  
  7. ; The disk created by this script is usually bigger than needed, but as it
  8. ; is, it should be useful for most any purpose.
  9.  
  10. ; INSTRUCTIONS:
  11. ; 1) This script assumes you're using a copy of your Commodore standard-
  12. ;    issue Workbench disk (it can have optional extras on it like
  13. ;    req.library or the "ls" command).  Make a backup copy if you haven't
  14. ;    done so yet.
  15. ; 2) Copy this file (MakeWB) to the S: directory of your Workbench copy.
  16. ; 3) Boot up with this copy of your standard-issue Workbench disk.
  17. ; 4) Open the Workbench icon and click twice on the "Shell" icon.
  18. ; 5) Type:  s:MakeWB <drive>
  19. ;           (where <drive> is df0: or df1: or fd0: or wherever your
  20. ;           Workbench disk was just booted from)
  21. ; 6) The MakeWB script will then create an image of a minimal disk in RAM:
  22. ;    and after it's done, you will be prompted to insert a formatted blank
  23. ;    disk in your boot drive.  The blank disk will become your minimal
  24. ;    Workbench boot disk.
  25.  
  26.  
  27. ; first, we resident some commands for efficiency and check syntax
  28.  
  29. failat 21
  30. if exists <drive>c/if
  31.    resident <drive>c/if pure
  32.    resident <drive>c/else pure
  33.    resident <drive>c/endif pure
  34. endif
  35. if exists <drive>c/echo
  36.    resident <drive>c/echo pure
  37. endif
  38.  
  39. failat 20
  40. echo "*e[H*e[2J*e[0;33;40m*nMAKE A MINIMAL WORKBENCH DISK.*e[0;31;40m*n"
  41. if <drive> EQ ""
  42.    echo "YOU MUST SPECIFY A DRIVE NAME, FOR EXAMPLE:"
  43.    echo "MakeWB df0:"
  44.    quit
  45. endif
  46.  
  47. echo "Please put your WRITE-PROTECTED standard Workbench floppy boot disk*nin drive <drive>."
  48. ask "Press the RETURN key when ready."
  49.  
  50. resident <drive>c/copy pure
  51. resident <drive>c/makedir pure
  52.  
  53. ; make necessary system directories
  54.  
  55. makedir ram:tempwb
  56. assign tempwb: ram:tempwb
  57.  
  58. echo "*nMaking necessary system directories in ram:"
  59. makedir tempwb:c      ; commands go here
  60. makedir tempwb:l      ; handlers go here
  61. makedir tempwb:s      ; startup-sequence goes here
  62. makedir tempwb:t      ; temp directory - used during boot-up
  63. makedir tempwb:libs   ; libraries go here
  64. makedir tempwb:devs   ; devices and system-configuration go here
  65. makedir tempwb:fonts  ; this will remain empty unless you copy a font to it
  66. makedir tempwb:system ; system utilities go here
  67. makedir tempwb:utilities ;empty
  68. makedir tempwb:prefs     ;empty
  69. if exists <drive>devs/DOSDrivers
  70.    makedir tempwb:devs/DOSDrivers
  71. endif
  72. if exists <drive>rexx
  73.    makedir tempwb:rexx
  74. endif
  75. if exists <drive>locale
  76.    makedir tempwb:locale
  77. endif
  78.  
  79. copy <drive>c/Install ram:          ; needed later
  80. copy <drive>c/Info ram:             ; needed later
  81.  
  82. ; copy mandatory commands to the c directory
  83.  
  84. echo "Copying necessary commands..."
  85. copy <drive>c/Addbuffers  tempwb:c  ; used in startup-sequence (optional)
  86. copy <drive>c/Assign      tempwb:c  ; used in startup-sequence for assigning ram dirs
  87. copy <drive>c/BindDrivers tempwb:c  ; required in startup
  88. if exists <drive>c/Break
  89.    copy <drive>c/Break    tempwb:c  ; required in startup
  90. endif
  91. if exists <drive>c/CD
  92.    copy <drive>c/CD       tempwb:c  ; very necessary for CLI use
  93. endif
  94. copy <drive>c/Copy        tempwb:c  ; often needed for CLI use
  95. if exists <drive>c/echo
  96.    copy <drive>c/echo     tempwb:c  ; needed by startup-sequence
  97. endif
  98. if exists <drive>c/EndCLI
  99.    copy <drive>c/EndCLI   tempwb:c  ; needed to close startup window
  100. endif
  101. copy <drive>c/Execute     tempwb:c  ; needed for Shell and other things
  102. if exists <drive>c/FF
  103.    copy <drive>c/FF       tempwb:c  ; required for faster text
  104. endif
  105. if exists <drive>c/FailAt
  106.    copy <drive>c/FailAt   tempwb:c  ; needed in startup-sequence
  107. endif
  108. if exists <drive>c/Mount
  109.    copy <drive>c/Mount    tempwb:c  ; needed by startup-sequence
  110. endif
  111. if exists <drive>c/Path
  112.    copy <drive>c/Path     tempwb:c  ; needed for Workbench and subsequent CLI's
  113. endif
  114. if exists <drive>c/Prompt
  115.    copy <drive>c/Prompt   tempwb:c  ; required by Shell-Startup
  116. endif
  117. if exists <drive>c/Resident
  118.    copy <drive>c/Resident tempwb:c  ; needed by startup-sequence
  119. endif
  120. if exists <drive>c/Run
  121.    copy <drive>c/Run      tempwb:c  ; needed by startup & other software
  122. endif
  123. copy <drive>c/SetPatch    tempwb:c  ; needed to fix bugs
  124. if exists <drive>c/SetClock
  125.    copy <drive>c/Setclock tempwb:c  ; needed in startup-sequence
  126. endif
  127. if exists <drive>c/Wait
  128.    copy <drive>c/Wait     tempwb:c  ; needed in startup-sequence
  129. endif
  130.  
  131. ; copy your favorite useful commands to the c directory
  132.  
  133. echo "Copying other useful commands..."
  134. copy <drive>c/Delete      tempwb:c  ; often needed for CLI use
  135. if exists <drive>c/ls
  136.    copy <drive>c/ls       tempwb:c  ; DIR replacement necessary for CLI use
  137. else
  138.    if exists <drive>c/Dir
  139.       copy <drive>c/Dir   tempwb:c  ; very neccessary for CLI use
  140.    endif
  141. endif
  142. copy <drive>c/LoadWB      tempwb:c  ; Delete this if you only want a CLI environment
  143. copy <drive>c/Makedir     tempwb:c  ; used in startup-sequence for making ram dirs
  144. if exists <drive>Shell
  145.    copy <drive>Shell#?    tempwb: quiet
  146. else
  147.    if exists <drive>system/Shell
  148.       copy <drive>system/Shell#? tempwb: quiet
  149.    endif
  150. endif
  151. if exists <drive>system/CLI
  152.    copy <drive>system/CLI#? tempwb:system quiet   ; needed for 1.3 Shell
  153. ;   if exists <drive>c/NewCLI
  154. ;      copy <drive>c/NewCLI tempwb:c  ; needed for creating new CLI windows
  155. ;   endif
  156. endif
  157. if exists <drive>system/more
  158.    copy <drive>system/More tempwb:c
  159. endif
  160. if exists <drive>c/IconX
  161.    copy <drive>c/Iconx tempwb:c
  162. endif
  163. if exists <drive>c/NewShell
  164.    copy <drive>c/NewShell tempwb:c
  165. endif
  166. copy <drive>c/Rename      tempwb:c  ; often needed for CLI use
  167. if exists <drive>system/SetMap
  168.    copy <drive>system/SetMap tempwb:system  ; needed for keyboard settings
  169. endif
  170. if exists <drive>c/Stack
  171.    copy <drive>c/Stack    tempwb:c  ; used in startup-sequence
  172. endif
  173. copy <drive>c/Type        tempwb:c  ; nice to have for CLI use
  174. if exists <drive>system/FastMemFirst
  175.    copy <drive>system/FastMemFirst tempwb:System  ; used in startup-sequence (optional)
  176. endif
  177.  
  178. ; copy necessary handlers
  179.  
  180. echo "Copying necessary handlers..."
  181. if exists <drive>l/Disk-Validator
  182.    copy <drive>l/Disk-Validator tempwb:l  ; needed when inserting a new disk
  183. endif
  184. if exists <drive>l/RAM-Handler
  185.    copy <drive>l/RAM-Handler tempwb:l  ; this is required for the ramdisk
  186. endif
  187. copy <drive>l/Port-Handler   tempwb:l  ; unnecessary if you don't use I/O ports
  188. if exists <drive>l/Shell-Seg
  189.    copy <drive>l/Shell-Seg   tempwb:l  ; needed for WB 1.3 Shell
  190. endif
  191. if exists <drive>l/Newcon-handler
  192.    copy <drive>l/Newcon-handler tempwb:l ; needed for NewShell
  193. endif
  194.  
  195. ; copy libraries (may be unnecessary depending on your application)
  196.  
  197. echo "Copying libraries..."
  198. ; copy <drive>libs/mathtrans.library tempwb:libs ; needed for transcendental functions
  199. if exists <drive>libs/icon.library
  200.    copy <drive>libs/icon.library  tempwb:libs  ; required for Workbench to load
  201. endif
  202. if exists <drive>libs/info.library
  203.    copy <drive>libs/info.library  tempwb:libs  ; WB "info" function - nice to have
  204. endif
  205. if exists <drive>libs/asl.library
  206.    copy <drive>/libs/asl.library tempwb:libs
  207. else
  208.    if exists <drive>libs/req.library
  209.       copy <drive>libs/req.library tempwb:libs ; file requester, nice to have
  210.    endif
  211. endif
  212. if exists <drive>libs/iffparse.library
  213.    copy <drive>libs/iffparse.library tempwb:libs
  214. endif
  215. copy <drive>libs/version.library tempwb:libs   ; sometimes needed, and small
  216. copy <drive>libs/diskfont.library tempwb:libs  ; often needed by software (you might
  217.                                             ; need a font in the fonts dir too)
  218. ; set up devices directory
  219.  
  220. echo "Setting up devs directory..."
  221. makedir tempwb:devs/keymaps
  222. makedir tempwb:devs/printers
  223. if exists <drive>devs/keymaps/usa1
  224.    copy <drive>devs/keymaps/usa1 tempwb:devs/keymaps   ; needed for A2000/A500 keybd
  225. endif
  226. copy <drive>devs/MountList   tempwb:devs
  227. copy <drive>devs/printers/#? tempwb:devs/printers quiet ; your printer driver goes here
  228. copy <drive>devs/clipboard.device tempwb:devs ; USUALLY unnecessary but sometimes used
  229. copy <drive>devs/parallel.device  tempwb:devs ; only needed if you use parallel port
  230. copy <drive>devs/printer.device   tempwb:devs ; only needed if you use a printer
  231. copy <drive>devs/serial.device    tempwb:devs ; only needed if you use serial port
  232. copy <drive>devs/system-configuration tempwb:devs  ; prefs - required for boot-up
  233.  
  234. ; now build the user's startup sequence in the s: directory
  235.  
  236. echo "Setting up s directory..."
  237. copy <drive>s/startup-sequence tempwb:s
  238. if exists <drive>s/startupII
  239.    echo > tempwb:s/startupII "resident c:Resident pure"
  240.    if exists tempwb:c/ls
  241.       echo >> tempwb:s/startupII "resident c:ls pure"
  242.    endif
  243.    echo >> tempwb:s/startupII "resident c:CD pure*nresident c:assign pure*nresident c:MakeDir pure"
  244.    echo >> tempwb:s/startupII "makedir ram:t*nmakedir ram:env*nmakedir ram:clipboards"
  245.    echo >> tempwb:s/startupII "assign T: ram:t*nassign ENV: ram:env*nassign CLIPS: ram:clipboards"
  246.    echo >> tempwb:s/startupII "resident Assign remove*nbreak 1 C"
  247. endif
  248. if exists <drive>s/dpat
  249.    copy <drive>s/dpat     tempwb:s  ; needed for rename
  250. endif
  251. if exists <drive>s/Shell-Startup
  252.    copy <drive>s/Shell-Startup tempwb:s
  253.    if exists tempwb:c/ls
  254.       echo >> tempwb:s/Shell-Startup "alias dir ls*nalias list ls -l"
  255.    endif
  256. endif
  257.  
  258. ; now copy the ram image to a blank disk
  259.  
  260. echo "*nPlease REMOVE the original Workbench boot disk.*n*nPlace a FORMATTED blank disk in drive <drive>."
  261. ask "Press the RETURN key when you are ready."
  262.  
  263. ram:install <drive>
  264. ram:install > NIL: <drive> check
  265. if WARN              ; condition is true if abnormal bootblock detected
  266.    echo "(The bootblock isn't normal.  You may have a virus.*nPlease check it out sometime.)"
  267. endif
  268. tempwb:c/delete ram:install
  269.  
  270. echo "*ncopying ram: image to <drive> and cleaning up memory..."
  271. tempwb:c/copy tempwb: <drive> all quiet
  272. if NOT exists tempwb:libs/asl.library
  273.    if NOT exists tempwb:libs/req.library
  274.       echo "*nYou should install req.library to the libs directory."
  275.    endif
  276. endif
  277. echo ""
  278. ram:info <drive>
  279. tempwb:c/delete ram:info
  280. tempwb:c/assign tempwb:
  281. ram:tempwb/c/delete ram:tempwb all quiet
  282. echo "*nAll done!  Space available on <drive> is shown above."
  283.